// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Serverless.Fluent;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning;

public sealed partial class DataframeEvaluationClassificationMetricsAucRoc
{
	/// <summary>
	/// <para>Name of the only class that is treated as positive during AUC ROC calculation. Other classes are treated as negative ("one-vs-all" strategy). All the evaluated documents must have class_name in the list of their top classes.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("class_name")]
	public Elastic.Clients.Elasticsearch.Serverless.Name? ClassName { get; set; }

	/// <summary>
	/// <para>Whether or not the curve should be returned in addition to the score. Default value is false.</para>
	/// </summary>
	[JsonInclude, JsonPropertyName("include_curve")]
	public bool? IncludeCurve { get; set; }
}

public sealed partial class DataframeEvaluationClassificationMetricsAucRocDescriptor : SerializableDescriptor<DataframeEvaluationClassificationMetricsAucRocDescriptor>
{
	internal DataframeEvaluationClassificationMetricsAucRocDescriptor(Action<DataframeEvaluationClassificationMetricsAucRocDescriptor> configure) => configure.Invoke(this);

	public DataframeEvaluationClassificationMetricsAucRocDescriptor() : base()
	{
	}

	private Elastic.Clients.Elasticsearch.Serverless.Name? ClassNameValue { get; set; }
	private bool? IncludeCurveValue { get; set; }

	/// <summary>
	/// <para>Name of the only class that is treated as positive during AUC ROC calculation. Other classes are treated as negative ("one-vs-all" strategy). All the evaluated documents must have class_name in the list of their top classes.</para>
	/// </summary>
	public DataframeEvaluationClassificationMetricsAucRocDescriptor ClassName(Elastic.Clients.Elasticsearch.Serverless.Name? className)
	{
		ClassNameValue = className;
		return Self;
	}

	/// <summary>
	/// <para>Whether or not the curve should be returned in addition to the score. Default value is false.</para>
	/// </summary>
	public DataframeEvaluationClassificationMetricsAucRocDescriptor IncludeCurve(bool? includeCurve = true)
	{
		IncludeCurveValue = includeCurve;
		return Self;
	}

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
		writer.WriteStartObject();
		if (ClassNameValue is not null)
		{
			writer.WritePropertyName("class_name");
			JsonSerializer.Serialize(writer, ClassNameValue, options);
		}

		if (IncludeCurveValue.HasValue)
		{
			writer.WritePropertyName("include_curve");
			writer.WriteBooleanValue(IncludeCurveValue.Value);
		}

		writer.WriteEndObject();
	}
}